package com.jingdianjichi.subject.common.enums;

import lombok.Getter;

/**
 * CategoryType   题目类型枚举
 *
 * @author 86178
 * @version 2024/03/17 21:03
 **/
@Getter
public enum SubjectInfoTypeEnum {

    RADIO(1, "单选"),
    MULTIPLE(2, "多选"),
    JUDGE(3, "判断"),
    BRIEF(4,"简答");

    public int code;

    public String description;

    SubjectInfoTypeEnum(int code, String description) {
        this.code = code;
        this.description = description;
    }

    public static SubjectInfoTypeEnum getByCode(int codeVal) {
        for (SubjectInfoTypeEnum resultCodeEnum : SubjectInfoTypeEnum.values()) {
            if (resultCodeEnum.code == codeVal) {
                return resultCodeEnum;
            }
        }
        return null;
    }
}

